const state = {
  isLoading: false// loading全局开关
}
const mutations = {
  toShow(state) {
    state.isLoading = true
    const newvar = state.isLoading
    state.isLoading = null
    state.isLoading = newvar
  },
  toHide(state) {
    state.isLoading = false
    const newvar = state.isLoading
    state.isLoading = null
    state.isLoading = newvar
  }
}
const actions = {
  setLoadingStatus({ commit }) {
    commit('toShow')
  }
}
const getter = {
  getStats() {
    return this.state.isLoading
  }
}
export default {
  namespace: true,
  state,
  mutations,
  actions,
  getter
}
